<?php

namespace App\Http\Middleware\Oauth;

use Closure;
use App\Services\Oauth\User as EntityUser;

/**
 * 验证是否登录
 */
class User
{

    /**
     * 前置
     * */
    public function handle($request, Closure $next)
    {
        $user = new EntityUser();
        return $user->checkUser() ? $next($request) : abort(401);
    }

}